using System;
using System.Collections.Generic;
using System.Text;
using Blazing.Web.Controls;
using System.Web.UI;

namespace Blazing.Util
{
    public class CmsManagerHelper
    {
        public CmsManagerHelper()
        {

        }

        public static CmsManager FindManagerObject(ControlCollection controls)
        {
            CmsManager retval = null;

            foreach (Control c in controls)
            {
                if (c.GetType() == typeof(CmsManager))
                {
                    retval = (CmsManager)c;
                    break;
                }
                if (c.Controls != null && c.Controls.Count > 0)
                {
                    retval = FindManagerObject(c.Controls);
                    if (retval != null)
                        break;
                }
            }

            return retval;
        }
    }
}
